﻿package cn.poco.pepsi.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class CacheOpenHelper extends SQLiteOpenHelper{
	private static String dbName = "imagecache.db";
	private static int version = 2;
	
	public CacheOpenHelper(Context context) {
		super(context,dbName, null, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		/*db.execSQL("CREATE TABLE cache (id integer primary key autoincrement, " +
				"url varchar(255), uri varchar(255));");*/
		db.execSQL("CREATE TABLE dish (id integer primary key autoincrement, " +
			"citycode varchar(50), dishid varchar(50),dishname varchar(50));");
		db.execSQL("CREATE TABLE t_review (id integer primary key autoincrement," +
				"res_code varchar(255), res_title varchar(255),res_star varchar(255)," +
				"res_average varchar(255),res_dish  varchar(255),res_circle  varchar(255)," +
				"res_address  varchar(255),res_tel  varchar(255),res_main_dish  varchar(255)," +
				"res_comments  varchar(255),res_images  varchar(255),res_intro  varchar(255)," +
				"res_location  varchar(255),res_join  varchar(255),res_pepsi  varchar(255)," +
				"res_discount  varchar(255));");
		db.execSQL("CREATE TABLE area (id integer primary key autoincrement,area_id varchar(255)," +
				"name varchar(255),city_code varchar(255));");
		db.execSQL("CREATE TABLE city (id integer primary key autoincrement,city_code varchar(255)," +
		"name varchar(255));");
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {	
		
	}



}
